<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- 这个地方必须得引入，否则会出现页面可缩放的问题-->
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>显示所有管理员用户</title>

    <!-- weui的相关css样式，需要引入-->
    <link rel="stylesheet" href="../css/weui.min.css">
    <link rel="stylesheet" href="../css/jquery-weui.min.css">
</head>
<body>
  <!--这块是列表的代码-->
  <div style="margin: 35px 0;">
      <h1>管理员列表</h1>
  </div>

  <div class="weui-cells__title">显示所有的登录用户</div>
  <div class="weui-cells" id="app">
    <div class="weui-cell" v-for="(item, index) in ret.data">
        <div class="weui-cell__bd">
            <p>{{ index }}:{{ item.username }}</p>
        </div
        <div class="weui-cell__ft">{{ item.usercode }}</div>
    </div>
  </div>


  <div class="weui-msg__extra-area">
      <div class="weui-footer">
          <p class="weui-footer__links">
              <a class="weui-footer__link" href="javascript:void(0);">底部链接地址</a>
          </p>
          <p class="weui-footer__text">Copyright © 2008-2016 weui.io</p>
      </div>
  </div>

<script src="../js/jquery.min.js"></script>
<script src="../js/jquery-weui.min.js"></script>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>

<form id="paraForm" style="display:none;">
 <input type="text" id="c" name="c" value="getSysusers">
</form>
<script>

new Vue({
        el:'#app',
        data:{ret:""},
        created:function(){
            var url="http://fdc56.buzhizhe.com:9167/d.ashx";
            var _self=this;
            //$.get(url,function(ret){
            //    _self.ret=eval("(" + ret +")");
            //})
            $.ajax({
                cache: true,
                type: "POST",
                url:url,
                data:$('#paraForm').serialize(),// 你的formid
                async: false,
                error: function(request) {
                    alert("网络连接错误");
                },
                success: function(data) {
                    var json=eval("(" + data +")");
                    if(json.ret==1){
                      alert("接口返回错误："+json.msg);
                    }else if(json.data instanceof Array){
                      _self.ret=json;
                    }
                    //alert(typeof _self.ret.data);
                }
            });
        }
      });


</script>
</body>
</html>
